import { S } from '../../s';
import { IPSAppCodeList } from '../../app/codelist/ipsapp-code-list';
import { IPSAppDEDataImportItem } from '../../app/dataentity/ipsapp-dedata-import-item';
import { IPSAppDEField } from '../../app/dataentity/ipsapp-defield';
import { IPSDEDataImportItem } from './ipsdedata-import-item';
import { IPSLanguageRes } from '../../res/ipslanguage-res';
import { PSModelObjectImpl } from '../../psmodel-object-impl';

export class PSDEDataImportItemImpl
  extends PSModelObjectImpl
  implements IPSDEDataImportItem, IPSAppDEDataImportItem
{
  protected cappslanguageres: IPSLanguageRes;
  getCapPSLanguageRes(): IPSLanguageRes | null {
    return (
      this.cappslanguageres ||
      (this.cappslanguageres = this.fillObjectModel(
        S._276,
        this.M.getCapPSLanguageRes,
        S._2a8,
      ) as IPSLanguageRes)
    );
  }

  get caption(): string {
    return this.M.caption;
  }

  get createDV(): string {
    return this.M.createDV;
  }

  get createDVT():
    | 'SESSION'
    | 'APPLICATION'
    | 'UNIQUEID'
    | 'CONTEXT'
    | 'PARAM'
    | 'OPERATOR'
    | 'OPERATORNAME'
    | 'CURTIME'
    | 'APPDATA' {
    return this.M.createDVT;
  }

  get orderValue(): number {
    return this.M.orderValue != null ? this.M.orderValue : 99999;
  }

  protected psappdefield: IPSAppDEField;
  getPSAppDEField(): IPSAppDEField | null {
    return (
      this.psappdefield ||
      (this.psappdefield = this.fillObjectModel(
        S._1,
        this.M.getPSAppDEField,
        S._2e4,
      ) as IPSAppDEField)
    );
  }

  protected pscodelist: IPSAppCodeList;
  getPSCodeList(): IPSAppCodeList | null {
    return (
      this.pscodelist ||
      (this.pscodelist = this.fillObjectModel(
        S._8,
        this.M.getPSCodeList,
        S._2e5,
      ) as IPSAppCodeList)
    );
  }

  get updateDV(): string {
    return this.M.updateDV;
  }

  get updateDVT():
    | 'SESSION'
    | 'APPLICATION'
    | 'UNIQUEID'
    | 'CONTEXT'
    | 'PARAM'
    | 'OPERATOR'
    | 'OPERATORNAME'
    | 'CURTIME'
    | 'APPDATA' {
    return this.M.updateDVT;
  }

  get hiddenDataItem(): boolean {
    return this.M.hiddenDataItem != null ? this.M.hiddenDataItem : false;
  }

  get uniqueItem(): boolean {
    return this.M.uniqueItem != null ? this.M.uniqueItem : false;
  }
  get cls(): string {
    return 'PSDEDataImportItemImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._1d6 || cls == S._1d7) return true;
    return super.instanceof(cls);
  }
}
